<?php

class PrintController extends DefaultBaseController {
	
	public function indexAction() {
		$this->_helper->layout()->setLayout('print');
		$id = (int)$this->getRequest()->getParam('id', 0);
		if($id > 0){
			$object = Obj_Object::getObject($id, true);
			switch($object['Сurrency']){
				case 1: $CurrencyHTML = "$"; break;
				case 2: $CurrencyHTML = "€"; break;
				case 3: $CurrencyHTML = "RUR"; break;
			}
			$object['CurrencyHTML'] = $CurrencyHTML;
			$object['images'] = Obj_Image::getImages($object['ID']);
			$object['Object_type'] = Obj_ObjectType::getObjectType($object['ObjectTypeId']);
			$object['country'] = Obj_Country::getCountry($object['CountryID']);
			$object['region'] = Obj_Region::getRegion($object['RegionID']);
			$object['city'] = Obj_City::getCity($object['CityID']);
			
			switch ($object['Attribute']) {
	    		case OBJECT_RENT: $this->view->objtypefile = 'kutochoarenda.png'; break;
	    		case OBJECT_INVESTMENT_PROJECT: $this->view->objtypefile = 'kutinvest.png'; break;
	    		case OBJECT_SALE: 
	    		default: $this->view->objtypefile = 'kutochoksale.png'; 
	    	}
			
			
			
			
			
			
			$this->view->object = $object;
			
			
			
		}
	}

}

/*<div class="_obj_breadscrumb"><a href="<?=HTTP_HOST?>/<?=$this->object['CountryAlias']?>"><?=$this->object['CountryName']?></a> | <a href="<?=HTTP_HOST?>/<?=$this->object['CountryAlias']?>/<?=$this->object['RegionAlias']?>"><?=$this->object['RegionName']?></a> | <a href="<?=HTTP_HOST?>/<?=$this->object['CountryAlias']?>/<?=$this->object['RegionAlias']?>/<?=$this->object['CityAlias']?>"><?=$this->object['CityName']?></a></div>*/